/**
 * Author: CreateSun
 * Date: 2020/8/15
 * Description:文档请求
 */

import Vue from 'vue';
const service = Vue.prototype.$http;

/**
 * 上传文档
 * @param params = {
    "fileTitle":"云征精神",
    "fileContent":"奋斗、奋斗、务实、创新",
    "projectId":"006"
 * }
 * @returns {AxiosPromise}
 */
export const filePost = params => {
    return service({
        url: 'file/post',
        method: 'post',
        data: params
    });
};

/**
 * 获取文档列表
 * @param params = {
 *     projectId
 * }
 * @returns {AxiosPromise}
 */
export const fileShowList = params => {
    return service({
        url: '/file/showList',
        method: 'get',
        params
    });
};

/**
 * 获取文档详细信息
 * @param params = {
 *     fileId
 * }
 * @returns {AxiosPromise}
 */
export const fileShow = params => {
    return service({
        url: '/file/show',
        method: 'get',
        params
    });
};

/**
 * 删除文档
 * @param params = {
 *     fileId
 * }
 * @returns {AxiosPromise}
 */
export const fileRemove = params => {
    return service({
        url: '/file/remove',
        method: 'delete',
        params
    });
};